From: Lee Date: Sat, 24 Apr 2021 17:03:35 +0000 (+0100) Subject: Magnifier: Filter caret tracking in gnome magnifier X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~243 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=006d206f98696035770e72ceec712c456122f330;p=gnome-shell.git Magnifier: Filter caret tracking in gnome magnifier Add a check to filter out caret tracking events that result in a caret location of 0,0. Fixes #4177 Part-of: --- diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 2f0a279a2..08466b9a0 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -827,6 +827,12 @@ var ZoomRegion = class ZoomRegion { let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; let [xCaret, yCaret] = [extents.x * scaleFactor, extents.y * scaleFactor]; + // Ignore event(s) if the caret size is none (0x0). This happens a lot if + // the cursor offset can't be translated into a location. This is a work + // around. + if (extents.width === 0 && extents.height === 0) + return; + if (this._xCaret !== xCaret || this._yCaret !== yCaret) { [this._xCaret, this._yCaret] = [xCaret, yCaret]; this._centerFromCaretPosition();